package body Versions is

   procedure Reset (v : in out Version_Type)
   is
   begin
      v := (0, 0);
   end Reset;

   function Has_Changed (
      v : Version_Type
      ) return Boolean
   is
   begin
      return v.Stable /= v.Change;
   end Has_Changed;

   -- 更新的补丁数
   function Patch_Count (
      v : Version_Type
      ) return Unsigned_32 
   is
   begin
      return v.Change - v.Stable;
   end Patch_Count;

   procedure Build (v : in out Version_Type)
   is
   begin
      v.Change := v.Change + 1;
   end Build;

   procedure Publish (v : in out Version_Type)
   is
   begin
      v.Stable := v.Change;
   end Publish;

end Versions;
